import 'package:enterprise_v6_app/app/core/http/http.dart';
import 'package:enterprise_v6_app/app/core/utils/interface.dart';
import 'package:enterprise_v6_app/app/data/entities/application/basic_information/hazard_facility_entity.dart';
import 'package:get/get.dart';

class EquipmentDetailsController extends GetxController {
  /// 文件id
  final String id = Get.arguments as String;

  /// 详情数据
  HazardFacilityEntity facilityEntity = HazardFacilityEntity();

  @override
  void onInit() {
    super.onInit();
    initData();
  }

  ///初始化页面数据
  Future<void> initData() async {
    final res = await HttpUtil().generateGetRequest<HazardFacilityEntity>(
      Interface.getFacilityDetail,
      queryParameters: {'id': id},
    ).execute();
    res.onSuccess((result) {
      if (result.data != null) {
        facilityEntity = result.data!;
      }
    });
    update();
  }
}
